package com.gzceb.zhgjj.web.dao;
// default package

import java.util.List;
import org.hibernate.LockMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.gzceb.zhgjj.web.entity.AcctOpen;

/**
 	* A data access object (DAO) providing persistence and search support for AcctOpen entities.
 			* Transaction control of the save(), update() and delete() operations 
		can directly support Spring container-managed transactions or they can be augmented	to handle user-managed Spring transactions. 
		Each of these methods provides additional information for how to configure it for the desired type of transaction control. 	
	 * @see .AcctOpen
  * @author MyEclipse Persistence Tools 
 */

public class AcctOpenDAO extends HibernateDaoSupport  {
	     private static final Logger log = LoggerFactory.getLogger(AcctOpenDAO.class);
		//property constants
	public static final String PAPERKIND = "paperkind";
	public static final String CUSTNAME = "custname";
	public static final String SEXSIGN = "sexsign";
	public static final String BIRTDATE = "birtdate";
	public static final String NATISIGN = "natisign";
	public static final String REGISEAT = "regiseat";
	public static final String MARRSIGN = "marrsign";
	public static final String EDUCSIGN = "educsign";
	public static final String VOCASIGN = "vocasign";
	public static final String TITLESIGN = "titlesign";
	public static final String PRINCIPLE = "principle";
	public static final String WORKCORP = "workcorp";
	public static final String INCO = "inco";
	public static final String ENSUNO = "ensuno";
	public static final String PROVINCE = "province";
	public static final String CITYNAME = "cityname";
	public static final String CUSTADDR = "custaddr";
	public static final String ADDRPOST = "addrpost";
	public static final String MOBILE = "mobile";
	public static final String FAMITEL = "famitel";
	public static final String CORPTEL = "corptel";
	public static final String EMAIL = "email";
	public static final String HANDBANKNAME = "handbankname";
	public static final String BISIKIND = "bisikind";
	public static final String LOANKIND = "loankind";
	public static final String FUNDCENTNO = "fundcentno";
	public static final String MGTDEPT = "mgtdept";
	public static final String LOANTYPE = "loantype";
	public static final String RELALOANID = "relaloanid";
	public static final String FIRSTORDER = "firstorder";
	public static final String PAYPERC = "payperc";
	public static final String ASSUKIND = "assukind";
	public static final String CONDATE = "condate";
	public static final String LOANAMT = "loanamt";
	public static final String TERMFREQ = "termfreq";
	public static final String LOANTERM = "loanterm";
	public static final String RETUTYPE = "retutype";
	public static final String LOANDUEDAY = "loandueday";
	public static final String SUBSFLAG = "subsflag";
	public static final String ISENOUSUBS = "isenousubs";
	public static final String FIRSTPAYAMT = "firstpayamt";
	public static final String FIRSTPAYPERC = "firstpayperc";
	public static final String ADDRID = "addrid";
	public static final String CORPID = "corpid";
	public static final String CORPNAME = "corpname";
	public static final String PROID = "proid";
	public static final String PRONAME = "proname";
	public static final String PAYEEACNO = "payeeacno";
	public static final String PAYEEACNAME = "payeeacname";
	public static final String PAYEEBANKNAME = "payeebankname";
	public static final String OUTPAYEEACNO = "outpayeeacno";
	public static final String OUTPAYEEACNAME = "outpayeeacname";
	public static final String LOANPROTYPE = "loanprotype";
	public static final String HOUSETYPE = "housetype";
	public static final String HOUSEFORMSIGN = "houseformsign";
	public static final String HOUSEAREA = "housearea";
	public static final String HOUSEAMT = "houseamt";
	public static final String HOUSEAGRENO = "houseagreno";
	public static final String HOUSEADDR = "houseaddr";
	public static final String HOUSEAVGPRICE = "houseavgprice";
	public static final String HOUSEBUILDYEAR = "housebuildyear";
	public static final String HOUSEUSEYEAR = "houseuseyear";
	public static final String CONTCODE = "contcode";
	public static final String PRERELEDATE = "prereledate";
	public static final String BANKID = "bankid";
	public static final String ACBANKNAME = "acbankname";
	public static final String ACBANKID = "acbankid";
	public static final String FUNDACCTNO = "fundacctno";
	public static final String FUNDSAVECARD = "fundsavecard";
	public static final String CORPFUNDACNO = "corpfundacno";
	public static final String CUSTFUNDACNO = "custfundacno";
	public static final String CORPFUNDTURNPROP = "corpfundturnprop";
	public static final String CUSTFUNDTURNPROP = "custfundturnprop";
	public static final String FUNDMONTHTURNAMT = "fundmonthturnamt";
	public static final String FUNDTURNBAL = "fundturnbal";
	public static final String FUNDTURNDATE = "fundturndate";
	public static final String SUBSACNO = "subsacno";
	public static final String ACNAME = "acname";
	public static final String BANKNAME = "bankname";
	public static final String RELATYPE = "relatype";
	public static final String RELACUSTID = "relacustid";
	public static final String LIABTYPE = "liabtype";
	public static final String LIABPERC = "liabperc";
	public static final String INPTIME = "inptime";



	protected void initDao() {
		//do nothing
	}
    
    public void save(AcctOpen transientInstance) {
        log.debug("saving AcctOpen instance");
        try {
            getHibernateTemplate().save(transientInstance);
            log.debug("save successful");
        } catch (RuntimeException re) {
            log.error("save failed", re);
            throw re;
        }
    }
    
	public void delete(AcctOpen persistentInstance) {
        log.debug("deleting AcctOpen instance");
        try {
            getHibernateTemplate().delete(persistentInstance);
            log.debug("delete successful");
        } catch (RuntimeException re) {
            log.error("delete failed", re);
            throw re;
        }
    }
	
	public AcctOpen findByPaperId(java.lang.String paperId){
		return findById(paperId);
	}
    
    public AcctOpen findById( java.lang.String id) {
        log.debug("getting AcctOpen instance with id: " + id);
        try {
            AcctOpen instance = (AcctOpen) getHibernateTemplate()
                    .get("com.gzceb.zhgjj.web.entity.AcctOpen", id);
            return instance;
        } catch (RuntimeException re) {
            log.error("get failed", re);
            throw re;
        }
    }
    
    
    public List findByExample(AcctOpen instance) {
        log.debug("finding AcctOpen instance by example");
        try {
            List results = getHibernateTemplate().findByExample(instance);
            log.debug("find by example successful, result size: " + results.size());
            return results;
        } catch (RuntimeException re) {
            log.error("find by example failed", re);
            throw re;
        }
    }    
    
    public List findByProperty(String propertyName, Object value) {
      log.debug("finding AcctOpen instance with property: " + propertyName
            + ", value: " + value);
      try {
         String queryString = "from AcctOpen as model where model." 
         						+ propertyName + "= ?";
		 return getHibernateTemplate().find(queryString, value);
      } catch (RuntimeException re) {
         log.error("find by property name failed", re);
         throw re;
      }
	}

	public List findByPaperkind(Object paperkind
	) {
		return findByProperty(PAPERKIND, paperkind
		);
	}
	
	public List findByCustname(Object custname
	) {
		return findByProperty(CUSTNAME, custname
		);
	}
	
	public List findBySexsign(Object sexsign
	) {
		return findByProperty(SEXSIGN, sexsign
		);
	}
	
	public List findByBirtdate(Object birtdate
	) {
		return findByProperty(BIRTDATE, birtdate
		);
	}
	
	public List findByNatisign(Object natisign
	) {
		return findByProperty(NATISIGN, natisign
		);
	}
	
	public List findByRegiseat(Object regiseat
	) {
		return findByProperty(REGISEAT, regiseat
		);
	}
	
	public List findByMarrsign(Object marrsign
	) {
		return findByProperty(MARRSIGN, marrsign
		);
	}
	
	public List findByEducsign(Object educsign
	) {
		return findByProperty(EDUCSIGN, educsign
		);
	}
	
	public List findByVocasign(Object vocasign
	) {
		return findByProperty(VOCASIGN, vocasign
		);
	}
	
	public List findByTitlesign(Object titlesign
	) {
		return findByProperty(TITLESIGN, titlesign
		);
	}
	
	public List findByPrinciple(Object principle
	) {
		return findByProperty(PRINCIPLE, principle
		);
	}
	
	public List findByWorkcorp(Object workcorp
	) {
		return findByProperty(WORKCORP, workcorp
		);
	}
	
	public List findByInco(Object inco
	) {
		return findByProperty(INCO, inco
		);
	}
	
	public List findByEnsuno(Object ensuno
	) {
		return findByProperty(ENSUNO, ensuno
		);
	}
	
	public List findByProvince(Object province
	) {
		return findByProperty(PROVINCE, province
		);
	}
	
	public List findByCityname(Object cityname
	) {
		return findByProperty(CITYNAME, cityname
		);
	}
	
	public List findByCustaddr(Object custaddr
	) {
		return findByProperty(CUSTADDR, custaddr
		);
	}
	
	public List findByAddrpost(Object addrpost
	) {
		return findByProperty(ADDRPOST, addrpost
		);
	}
	
	public List findByMobile(Object mobile
	) {
		return findByProperty(MOBILE, mobile
		);
	}
	
	public List findByFamitel(Object famitel
	) {
		return findByProperty(FAMITEL, famitel
		);
	}
	
	public List findByCorptel(Object corptel
	) {
		return findByProperty(CORPTEL, corptel
		);
	}
	
	public List findByEmail(Object email
	) {
		return findByProperty(EMAIL, email
		);
	}
	
	public List findByHandbankname(Object handbankname
	) {
		return findByProperty(HANDBANKNAME, handbankname
		);
	}
	
	public List findByBisikind(Object bisikind
	) {
		return findByProperty(BISIKIND, bisikind
		);
	}
	
	public List findByLoankind(Object loankind
	) {
		return findByProperty(LOANKIND, loankind
		);
	}
	
	public List findByFundcentno(Object fundcentno
	) {
		return findByProperty(FUNDCENTNO, fundcentno
		);
	}
	
	public List findByMgtdept(Object mgtdept
	) {
		return findByProperty(MGTDEPT, mgtdept
		);
	}
	
	public List findByLoantype(Object loantype
	) {
		return findByProperty(LOANTYPE, loantype
		);
	}
	
	public List findByRelaloanid(Object relaloanid
	) {
		return findByProperty(RELALOANID, relaloanid
		);
	}
	
	public List findByFirstorder(Object firstorder
	) {
		return findByProperty(FIRSTORDER, firstorder
		);
	}
	
	public List findByPayperc(Object payperc
	) {
		return findByProperty(PAYPERC, payperc
		);
	}
	
	public List findByAssukind(Object assukind
	) {
		return findByProperty(ASSUKIND, assukind
		);
	}
	
	public List findByCondate(Object condate
	) {
		return findByProperty(CONDATE, condate
		);
	}
	
	public List findByLoanamt(Object loanamt
	) {
		return findByProperty(LOANAMT, loanamt
		);
	}
	
	public List findByTermfreq(Object termfreq
	) {
		return findByProperty(TERMFREQ, termfreq
		);
	}
	
	public List findByLoanterm(Object loanterm
	) {
		return findByProperty(LOANTERM, loanterm
		);
	}
	
	public List findByRetutype(Object retutype
	) {
		return findByProperty(RETUTYPE, retutype
		);
	}
	
	public List findByLoandueday(Object loandueday
	) {
		return findByProperty(LOANDUEDAY, loandueday
		);
	}
	
	public List findBySubsflag(Object subsflag
	) {
		return findByProperty(SUBSFLAG, subsflag
		);
	}
	
	public List findByIsenousubs(Object isenousubs
	) {
		return findByProperty(ISENOUSUBS, isenousubs
		);
	}
	
	public List findByFirstpayamt(Object firstpayamt
	) {
		return findByProperty(FIRSTPAYAMT, firstpayamt
		);
	}
	
	public List findByFirstpayperc(Object firstpayperc
	) {
		return findByProperty(FIRSTPAYPERC, firstpayperc
		);
	}
	
	public List findByAddrid(Object addrid
	) {
		return findByProperty(ADDRID, addrid
		);
	}
	
	public List findByCorpid(Object corpid
	) {
		return findByProperty(CORPID, corpid
		);
	}
	
	public List findByCorpname(Object corpname
	) {
		return findByProperty(CORPNAME, corpname
		);
	}
	
	public List findByProid(Object proid
	) {
		return findByProperty(PROID, proid
		);
	}
	
	public List findByProname(Object proname
	) {
		return findByProperty(PRONAME, proname
		);
	}
	
	public List findByPayeeacno(Object payeeacno
	) {
		return findByProperty(PAYEEACNO, payeeacno
		);
	}
	
	public List findByPayeeacname(Object payeeacname
	) {
		return findByProperty(PAYEEACNAME, payeeacname
		);
	}
	
	public List findByPayeebankname(Object payeebankname
	) {
		return findByProperty(PAYEEBANKNAME, payeebankname
		);
	}
	
	public List findByOutpayeeacno(Object outpayeeacno
	) {
		return findByProperty(OUTPAYEEACNO, outpayeeacno
		);
	}
	
	public List findByOutpayeeacname(Object outpayeeacname
	) {
		return findByProperty(OUTPAYEEACNAME, outpayeeacname
		);
	}
	
	public List findByLoanprotype(Object loanprotype
	) {
		return findByProperty(LOANPROTYPE, loanprotype
		);
	}
	
	public List findByHousetype(Object housetype
	) {
		return findByProperty(HOUSETYPE, housetype
		);
	}
	
	public List findByHouseformsign(Object houseformsign
	) {
		return findByProperty(HOUSEFORMSIGN, houseformsign
		);
	}
	
	public List findByHousearea(Object housearea
	) {
		return findByProperty(HOUSEAREA, housearea
		);
	}
	
	public List findByHouseamt(Object houseamt
	) {
		return findByProperty(HOUSEAMT, houseamt
		);
	}
	
	public List findByHouseagreno(Object houseagreno
	) {
		return findByProperty(HOUSEAGRENO, houseagreno
		);
	}
	
	public List findByHouseaddr(Object houseaddr
	) {
		return findByProperty(HOUSEADDR, houseaddr
		);
	}
	
	public List findByHouseavgprice(Object houseavgprice
	) {
		return findByProperty(HOUSEAVGPRICE, houseavgprice
		);
	}
	
	public List findByHousebuildyear(Object housebuildyear
	) {
		return findByProperty(HOUSEBUILDYEAR, housebuildyear
		);
	}
	
	public List findByHouseuseyear(Object houseuseyear
	) {
		return findByProperty(HOUSEUSEYEAR, houseuseyear
		);
	}
	
	public List findByContcode(Object contcode
	) {
		return findByProperty(CONTCODE, contcode
		);
	}
	
	public List findByPrereledate(Object prereledate
	) {
		return findByProperty(PRERELEDATE, prereledate
		);
	}
	
	public List findByBankid(Object bankid
	) {
		return findByProperty(BANKID, bankid
		);
	}
	
	public List findByAcbankname(Object acbankname
	) {
		return findByProperty(ACBANKNAME, acbankname
		);
	}
	
	public List findByAcbankid(Object acbankid
	) {
		return findByProperty(ACBANKID, acbankid
		);
	}
	
	public List findByFundacctno(Object fundacctno
	) {
		return findByProperty(FUNDACCTNO, fundacctno
		);
	}
	
	public List findByFundsavecard(Object fundsavecard
	) {
		return findByProperty(FUNDSAVECARD, fundsavecard
		);
	}
	
	public List findByCorpfundacno(Object corpfundacno
	) {
		return findByProperty(CORPFUNDACNO, corpfundacno
		);
	}
	
	public List findByCustfundacno(Object custfundacno
	) {
		return findByProperty(CUSTFUNDACNO, custfundacno
		);
	}
	
	public List findByCorpfundturnprop(Object corpfundturnprop
	) {
		return findByProperty(CORPFUNDTURNPROP, corpfundturnprop
		);
	}
	
	public List findByCustfundturnprop(Object custfundturnprop
	) {
		return findByProperty(CUSTFUNDTURNPROP, custfundturnprop
		);
	}
	
	public List findByFundmonthturnamt(Object fundmonthturnamt
	) {
		return findByProperty(FUNDMONTHTURNAMT, fundmonthturnamt
		);
	}
	
	public List findByFundturnbal(Object fundturnbal
	) {
		return findByProperty(FUNDTURNBAL, fundturnbal
		);
	}
	
	public List findByFundturndate(Object fundturndate
	) {
		return findByProperty(FUNDTURNDATE, fundturndate
		);
	}
	
	public List findBySubsacno(Object subsacno
	) {
		return findByProperty(SUBSACNO, subsacno
		);
	}
	
	public List findByAcname(Object acname
	) {
		return findByProperty(ACNAME, acname
		);
	}
	
	public List findByBankname(Object bankname
	) {
		return findByProperty(BANKNAME, bankname
		);
	}
	
	public List findByRelatype(Object relatype
	) {
		return findByProperty(RELATYPE, relatype
		);
	}
	
	public List findByRelacustid(Object relacustid
	) {
		return findByProperty(RELACUSTID, relacustid
		);
	}
	
	public List findByLiabtype(Object liabtype
	) {
		return findByProperty(LIABTYPE, liabtype
		);
	}
	
	public List findByLiabperc(Object liabperc
	) {
		return findByProperty(LIABPERC, liabperc
		);
	}
	
	public List findByInptime(Object inptime
	) {
		return findByProperty(INPTIME, inptime
		);
	}
	

	public List findAll() {
		log.debug("finding all AcctOpen instances");
		try {
			String queryString = "from AcctOpen";
		 	return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}
	
    public AcctOpen merge(AcctOpen detachedInstance) {
        log.debug("merging AcctOpen instance");
        try {
            AcctOpen result = (AcctOpen) getHibernateTemplate()
                    .merge(detachedInstance);
            log.debug("merge successful");
            return result;
        } catch (RuntimeException re) {
            log.error("merge failed", re);
            throw re;
        }
    }

    public void attachDirty(AcctOpen instance) {
        log.debug("attaching dirty AcctOpen instance");
        try {
            getHibernateTemplate().saveOrUpdate(instance);
            log.debug("attach successful");
        } catch (RuntimeException re) {
            log.error("attach failed", re);
            throw re;
        }
    }
    
    public void attachClean(AcctOpen instance) {
        log.debug("attaching clean AcctOpen instance");
        try {
            getHibernateTemplate().lock(instance, LockMode.NONE);
            log.debug("attach successful");
        } catch (RuntimeException re) {
            log.error("attach failed", re);
            throw re;
        }
    }

	public static AcctOpenDAO getFromApplicationContext(ApplicationContext ctx) {
    	return (AcctOpenDAO) ctx.getBean("acctOpenDAO");
	}
}